package com.minjiang.system.service.sec.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.minjiang.model.system.MyDynamic;
import com.minjiang.model.system.MyMotion;
import com.minjiang.model.vo.MyMotionQueryVo;
import com.minjiang.system.service.sec.MyMotionService;
import com.minjiang.system.mapper.sec.MyMotionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
* @author Administrator
* @description 针对表【my_motion(运动数据)】的数据库操作Service实现
* @createDate 2022-12-18 20:20:30
*/
@Service
public class MyMotionServiceImpl extends ServiceImpl<MyMotionMapper, MyMotion>
    implements MyMotionService{

    @Autowired
    private MyMotionMapper myMotionMapper;
    @Override
    public IPage<MyMotion> selectPage(Page<MyMotion> pageParam, MyMotionQueryVo dynamicQueryVo) {
        //获取条件值
        String keyword = dynamicQueryVo.getKeyword();
        String createTimeBegin = dynamicQueryVo.getCreateTimeBegin();
        String createTimeEnd = dynamicQueryVo.getCreateTimeEnd();
        //封装条件
        QueryWrapper<MyMotion> wrapper = new QueryWrapper<>();
        if(!StringUtils.isEmpty(keyword)) {
            wrapper.like("text",keyword);
        }
        //调用mapper方法
        IPage<MyMotion> pageModel = myMotionMapper.selectPage(pageParam, wrapper);


        return pageModel;
    }
}




